package loja.view.editor.components;

import java.util.List;

public class StatesEditor {

	public static final int CANCEL = 0;
	public static final int EDIT = 1;
	public static final int END = 2;
	public static final int INCLUDE = 3;
	public static final int REMOVE = 4;
	public static final int SAVE = 5;
	public static final int START = 6;

	public static void setStateForComponentEditor(
			ComponentEditor componentEditor, int state) {

		switch (state) {

		case CANCEL:
			componentEditor.onCancel();
			break;
		case EDIT:
			componentEditor.onEdit();
			break;
		case END:
			componentEditor.onEnd();
			break;
		case INCLUDE:
			componentEditor.onInclude();
			break;
		case REMOVE:
			componentEditor.onRemove();
			break;
		case SAVE:
			componentEditor.onSave();
			break;
		case START:
			componentEditor.onStart();
			break;

		default:
			componentEditor.onCancel();
		}

	}

	public static void setStateForComponentEditor(
			List<ComponentEditor> componentsEditor, int state) {
		for (ComponentEditor componentEditor : componentsEditor) {
			setStateForComponentEditor(componentEditor, state);
		}
	}

}
